package com.java46.struts2.base.entity;

import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.Objects;

/**
 * @ClassName TOrderEntity
 * @Description 订单信息
 * @Author zuxia
 * @Date 2018/7/17 14:38
 * @Vcrsion 1.0
 **/
@Entity
@Table(name = "t_order", schema = "fullboydb")
public class TOrderEntity {
    private int orderId;
    private String orderNo;
    private int tableNo;
    private int pNum;
    private String remark;
    private Timestamp createTime;
    private BigDecimal totalMoney;
    private Integer payType;
    private int struts;
    private int uId;

    @Id
    @Column(name = "orderId")
//    @GenericGenerator(name = "t_orderId",strategy = "identity")
//    @GeneratedValue(generator = "t_orderId")
    public int getOrderId() {
        return orderId;
    }

    public void setOrderId(int orderId) {
        this.orderId = orderId;
    }

    @Basic
    @Column(name = "orderNo")
    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    @Basic
    @Column(name = "tableNo")
    public int getTableNo() {
        return tableNo;
    }

    public void setTableNo(int tableNo) {
        this.tableNo = tableNo;
    }

    @Basic
    @Column(name = "pNum")
    public int getpNum() {
        return pNum;
    }

    public void setpNum(int pNum) {
        this.pNum = pNum;
    }

    @Basic
    @Column(name = "remark")
    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Basic
    @Column(name = "createTime")
    public Timestamp getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Timestamp createTime) {
        this.createTime = createTime;
    }

    @Basic
    @Column(name = "totalMoney")
    public BigDecimal getTotalMoney() {
        return totalMoney;
    }

    public void setTotalMoney(BigDecimal totalMoney) {
        this.totalMoney = totalMoney;
    }

    @Basic
    @Column(name = "payType")
    public Integer getPayType() {
        return payType;
    }

    public void setPayType(Integer payType) {
        this.payType = payType;
    }

    @Basic
    @Column(name = "struts")
    public int getStruts() {
        return struts;
    }

    public void setStruts(int struts) {
        this.struts = struts;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TOrderEntity that = (TOrderEntity) o;
        return orderId == that.orderId &&
                tableNo == that.tableNo &&
                pNum == that.pNum &&
                struts == that.struts &&
                Objects.equals(orderNo, that.orderNo) &&
                Objects.equals(remark, that.remark) &&
                Objects.equals(createTime, that.createTime) &&
                Objects.equals(totalMoney, that.totalMoney) &&
                Objects.equals(payType, that.payType);
    }

    @Override
    public int hashCode() {

        return Objects.hash(orderId, orderNo, tableNo, pNum, remark, createTime, totalMoney, payType, struts);
    }

    @Basic
    @Column(name = "uId")
    public int getuId() {
        return uId;
    }

    public void setuId(int uId) {
        this.uId = uId;
    }
}
